import java.util.*;
import java.sql.*;
import static java.lang.Math.*;


class PetDog{
    public String name;
    public String color;
    public void bark(){
        System.out.println("汪汪叫~~");
    }
    public void wag(){
        System.out.println("摇尾巴~~");
    }
}

class Data

{
    public int year;
    public int month;
    public int day;
    public void setData(int year,int month,int day){
        this.year=year;
        this.month=month;
        this.day=day;
    }
    public void show(){
        System.out.println("年："+year+" 月："+month+" 日："+day);
    }
}


public class Test {
    public static void main(String[] args) {
        double x=30;
        double y=40;
        //静态导入的方式更加方便一些
        double result1=Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
        System.out.println(result1);

        double result2=sqrt(pow(x,2)+pow(y,2));
        System.out.println(result2);
    }





    public static void main4(String[] args) {
        java.util.Date data=new java.util.Date();
        System.out.println(data.getTime());
    }

    public static void main3(String[] args) {
        java.util.Date data=new java.util.Date();
        //得到一个毫秒级别的时间戳
        System.out.println(data.getTime());
    }

    public static void main2(String[] args) {
        Data data1=new Data();//新建一个对象
        Data data2=new Data();
        Data data3=new Data();
        data1.setData(2024,1,30);//引用对象的函数赋值日期
        data2.setData(2024,2,30);
        data3.setData(2024,3,30);
        data1.show();//引用对象的函数打印数据
        data2.show();
        data3.show();
    }



    public static void main1(String[] args) {
       PetDog dog1=new PetDog();//通过new实例化对象
        dog1.name="阿黄";
        dog1.color="黑黄";
        System.out.println(dog1.name);
        System.out.println(dog1.color);
        dog1.bark();
        dog1.wag();
    }
}